package com.example.robertluozizhao.framecollectdemo.event.rx;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Created by robert.luozizhao on 2018/1/24.
 */

public class RxBus { // 懒汉式 双从非空判断
    private static RxBus rxBusInstance;

    private RxBus(){};

    public static RxBus getInstance(){
        if (rxBusInstance==null) {
            synchronized (RxBus.class){
                if (rxBusInstance==null) {
                    rxBusInstance = new RxBus();
                }
            }
        }
        return rxBusInstance;
    }

    @Target(ElementType.METHOD)
    @Retention(RetentionPolicy.RUNTIME)
    public @interface Subscribe{}


}
